<!--  -->
<template>
    <div class='hotelAdd'>
        <div style="color:red;">注：酒店外采数据尽量多填</div>
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" size="mini" label-width="160px" class="demo-ruleForm">
            <div style="display:flex;">
                <el-form-item label="城市名称" prop="cityName">
                    <el-input v-model="ruleForm.cityName"></el-input>
                </el-form-item>
                <el-form-item label="区/市名称" prop="countyName">
                    <el-input v-model="ruleForm.countyName"></el-input>
                </el-form-item>
                <el-form-item label="酒店名称" prop="hotelName">
                    <el-input v-model="ruleForm.hotelName"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="酒店拼音" prop="pinYin">
                    <el-input v-model="ruleForm.pinYin"></el-input>
                </el-form-item>
                <el-form-item label="酒店简拼" prop="jianPin">
                    <el-input v-model="ruleForm.jianPin"></el-input>
                </el-form-item>
                <el-form-item label="酒店类型" prop="typeId">
                    <el-select v-model="ruleForm.typeId" placeholder="请选择活动区域">
                        <el-option label="预付" value="1"></el-option>
                        <el-option label="现付" value="2"></el-option>
                        <el-option label="担保" value="3"></el-option>
                    </el-select>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="星级编号" prop="starId">
                    <el-input v-model="ruleForm.starId" oninput="value=value.replace(/[^\d.]/g,'')"></el-input>
                </el-form-item>
                <el-form-item label="主题" prop="themes">
                    <el-input v-model="ruleForm.themes"></el-input>
                </el-form-item>
                <el-form-item label="商圈名称" prop="circleName">
                    <el-input v-model="ruleForm.circleName"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="星级名称" prop="starName">
                    <el-input v-model="ruleForm.starName">
                    </el-input>
                </el-form-item>
                <el-form-item label="品牌名称" prop="brandName">
                    <el-input v-model="ruleForm.brandName"></el-input>
                </el-form-item>
                <el-form-item label="附近标识" prop="nearLandmark">
                    <el-input v-model="ruleForm.nearLandmark"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="标签" prop="featureName">
                    <el-select style="width:183px;" v-model="ruleForm.featureName" placeholder="请选择标签">
                        <el-option label="热卖酒店" value="热卖酒店"></el-option>
                        <el-option label="地铁周边" value="地铁周边"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="活动标签" prop="activelabelName">
                    <el-input v-model="ruleForm.activelabelName"></el-input>
                </el-form-item>
                <el-form-item label="评分" prop="commentScore">
                    <el-input v-model="ruleForm.commentScore" oninput="value=value.replace(/[^\d.]/g,'')"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="地址" prop="address">
                    <el-input v-model="ruleForm.address" style="width:800px;" type="textarea" :rows="2"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="高德纬度" prop="googleLat">
                    <el-input v-model="ruleForm.googleLat" style="width:300px;" type="textarea" :rows="1" oninput="value=value.replace(/[^\d.]/g,'')"></el-input>
                </el-form-item>
                <el-form-item label="高德经度" prop="googleLon">
                    <el-input v-model="ruleForm.googleLon" style="width:300px;" type="textarea" :rows="1" oninput="value=value.replace(/[^\d.]/g,'')"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="百度纬度" prop="baiduLat">
                    <el-input v-model="ruleForm.baiduLat" style="width:300px;" type="textarea" :rows="1" oninput="value=value.replace(/[^\d.]/g,'')"></el-input>
                </el-form-item>
                <el-form-item label="百度经度" prop="baiduLon">
                    <el-input v-model="ruleForm.baiduLon" style="width:300px;" type="textarea" :rows="1" oninput="value=value.replace(/[^\d.]/g,'')"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="评论数" prop="commentCount">
                    <el-input v-model="ruleForm.commentCount" oninput="value=value.replace(/[^\d.]/g,'')"></el-input>
                </el-form-item>
                <el-form-item label="最低价" prop="baseMinPrice">
                    <el-input v-model="ruleForm.baseMinPrice" oninput="value=value.replace(/[^\d.]/g,'')"></el-input>
                </el-form-item>
                <el-form-item label="是否有效" prop="isValid">
                    <el-select style="width:183px;" v-model="ruleForm.isValid">
                        <el-option label="是" value="1"></el-option>
                        <el-option label="否" value="0"></el-option>
                    </el-select>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="推荐级别" prop="recommendLevel">
                    <el-select style="width:183px;" v-model="ruleForm.recommendLevel" placeholder="请选择标签">
                        <el-option label="特牌" value="6"></el-option>
                        <el-option label="金牌" value="5"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="酒店英文名称" prop="hotelEname">
                    <el-input v-model="ruleForm.hotelEname"></el-input>
                </el-form-item>
                <el-form-item label="邮编" prop="postCode">
                    <el-input v-model="ruleForm.postCode"></el-input>
                </el-form-item>
            </div>

            <div style="display:flex;">
                <el-form-item label="是否公寓" prop="isApartment">
                    <el-select style="width:183px;" v-model="ruleForm.isApartment" placeholder="请选择标签">
                        <el-option label="否" value="0"></el-option>
                        <el-option label="是" value="1"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="开业时间" prop="openingDate">
                    <el-date-picker value-format="yyyy-MM-dd" v-model="ruleForm.openingDate" type="date"
                        placeholder="选择日期">
                    </el-date-picker>
                </el-form-item>
                <el-form-item label="是否经济型" prop="isEconomic">
                    <el-select style="width:183px;" v-model="ruleForm.isEconomic" placeholder="请选择标签">
                        <el-option label="否" value="0"></el-option>
                        <el-option label="是" value="1"></el-option>
                    </el-select>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="传真" prop="fax">
                    <el-input v-model="ruleForm.fax"></el-input>
                </el-form-item>
                <el-form-item label="装修日期" prop="renovationDate">
                    <el-date-picker value-format="yyyy-MM-dd" v-model="ruleForm.renovationDate" type="date"
                        placeholder="选择日期">
                    </el-date-picker>
                </el-form-item>
                <el-form-item label="前台电话" prop="phone">
                    <el-input v-model="ruleForm.phone"></el-input>
                </el-form-item>
            </div>

            <div style="display:flex;">
                <el-form-item label="酒店设施" prop="facilities">
                    <el-input v-model="ruleForm.facilities" style="width:800px;" type="textarea" :rows="2"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="酒店基础设施" prop="generalAmenities">
                    <el-input v-model="ruleForm.generalAmenities" style="width:800px;" type="textarea" :rows="2"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="酒店休闲设施" prop="recreationAmenities">
                    <el-input v-model="ruleForm.recreationAmenities" style="width:800px;" type="textarea" :rows="2"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="酒店服务设施" prop="serviceAmenities">
                    <el-input v-model="ruleForm.serviceAmenities" style="width:800px;" type="textarea" :rows="2"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="卖点" prop="sellingPoint">
                    <el-input v-model="ruleForm.sellingPoint" style="width:800px;" type="textarea" :rows="2"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="酒店简介" prop="houseIntro">
                    <el-input v-model="ruleForm.houseIntro" style="width:800px;" type="textarea" :rows="2"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="提示" prop="tips">
                    <el-input v-model="ruleForm.tips" style="width:300px;" type="textarea" :rows="1"></el-input>
                </el-form-item>
                <el-form-item label="交通" prop="traffic">
                    <el-input v-model="ruleForm.traffic" style="width:300px;" type="textarea" :rows="1"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="周边信息" prop="surroundings">
                    <el-input v-model="ruleForm.surroundings" type="textarea" :rows="1"></el-input>
                </el-form-item>
                <el-form-item label="入住时间" prop="checkinTime">
                    <el-date-picker value-format="yyyy-MM-dd" v-model="ruleForm.checkinTime" type="date"
                        placeholder="选择日期">
                    </el-date-picker>
                </el-form-item>
                <el-form-item label="服务" prop="servicess">
                    <el-input v-model="ruleForm.servicess" type="textarea" :rows="1"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="停车位" prop="parkingLot">
                    <el-input v-model="ruleForm.parkingLot" type="textarea" :rows="1"></el-input>
                </el-form-item>
                <el-form-item label="特色信息" prop="features">
                    <el-input v-model="ruleForm.features" type="textarea" :rows="1"></el-input>
                </el-form-item>
                <el-form-item label="标签" prop="featureName">
                    <el-input v-model="ruleForm.featureName" type="textarea" :rows="1"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="酒店儿童政策" prop="child">
                    <el-input v-model="ruleForm.child" style="width:800px;" type="textarea" :rows="2"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="自助早餐" prop="meal">
                    <el-input v-model="ruleForm.meal" type="textarea" :rows="1"></el-input>
                </el-form-item>
                <el-form-item label="宠物" prop="pet">
                    <el-input v-model="ruleForm.pet" type="textarea" :rows="1"></el-input>
                </el-form-item>
                <el-form-item label="备注" prop="remarks">
                    <el-input v-model="ruleForm.remarks" type="textarea" :rows="1"></el-input>
                </el-form-item>
            </div>
            <div>
                <el-form-item label="酒店图片 :" style=" margin: 0 20px 0 0">
                    <el-upload ref="upload" :limit="1" action="/file/fileMapping/uploadAvatar" list-type="picture-card"
                    :on-success="handleAvatarSuccess" :on-preview="handlePictureCardPreview" :on-remove="handleRemove">
                    <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
            </div>
                <div style="width:100%"><el-button type="primary" style="margin-left:80%;" size="mini" @click.stop="addroomtype()">添加房型</el-button></div>
            <div v-for="(item, index) in hotelRoomList" :key="(item, index)">
                <div style="width:100%"> <el-button
                        class="passengers_1"
                        type="danger"
                        icon="el-icon-delete"
                        circle
                        size="mini"
                        style="margin-left:80%;"
                        @click="handelDelet(item, index)"
                      ></el-button></div>
                
                    <div style="display:flex;"   >
                        <el-form-item label="房型名称" prop="roomName">
                            <el-input v-model="item.roomName" type="textarea" :rows="1"></el-input>
                        </el-form-item>
                        <el-form-item label="房型英文名称" prop="roomEn">
                            <el-input v-model="item.roomEn" type="textarea" :rows="1"></el-input>
                        </el-form-item>
                        <el-form-item label="房型代码" prop="roomCode">
                            <el-input v-model="item.roomCode" ></el-input>
                        </el-form-item>
                    </div>

                    <div style="display:flex;">
                        <el-form-item label="房型面积" prop="roomArea">
                            <el-input v-model="item.roomArea"></el-input>
                        </el-form-item>
                        <el-form-item label="房间楼层" prop="roomFloor">
                            <el-input v-model="item.roomFloor"></el-input>
                        </el-form-item>
                        <el-form-item label="房间容纳人数" prop="roomPersonCount">
                            <el-input v-model="item.roomPersonCount"></el-input>
                        </el-form-item>
                    </div>
                    <div style="display:flex;">
                        <el-form-item label="wifi" prop="roomWifi">
                            <el-input v-model="item.roomWifi"></el-input>
                        </el-form-item>
                        <el-form-item label="房型描述" prop="roomDesc">
                            <el-input v-model="item.roomDesc" type="textarea" :rows="1"></el-input>
                        </el-form-item>
                        <el-form-item label="床型类型" prop="roomBedType">
                            <el-input v-model="item.roomBedType" type="textarea" :rows="1"></el-input>
                        </el-form-item>
                    </div>
                    <div style="display:flex;">
                        <el-form-item label="床型数量" prop="roomBedCount">
                            <el-input v-model="item.roomBedCount"></el-input>
                        </el-form-item>
                        <el-form-item label="床型宽度" prop="roomBedWidth">
                            <el-input v-model="item.roomBedWidth"></el-input>
                        </el-form-item>
                        <el-form-item label="床型描述" prop="roomBedDesc">
                            <el-input v-model="item.roomBedDesc" type="textarea" :rows="1"></el-input>
                        </el-form-item>
                    </div>

                    <div style="display:flex;">
                        <el-form-item label="价格类型" prop="priceType">
                            <el-input v-model="item.priceType" type="textarea" :rows="1"></el-input>
                        </el-form-item>
                        <el-form-item label="价格开始时间" prop="beginDate">
                            <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="item.hotelRoomPriceList[0].beginDate" type="datetime"
                                placeholder="选择日期">
                            </el-date-picker>
                        </el-form-item>
                        <el-form-item label="价格结束时间" prop="endDate">
                            <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="item.hotelRoomPriceList[0].endDate" type="datetime"
                                placeholder="选择日期">
                            </el-date-picker>
                        </el-form-item>
                    </div>
                    <div style="display:flex;">
                        <el-form-item label="佣金" prop="commission">
                            <el-input v-model="item.commission" oninput="value=value.replace(/[^\d.]/g,'')"></el-input>
                        </el-form-item>
                        <el-form-item label="成本价" prop="basePrice">
                            <el-input v-model="item.basePrice" oninput="value=value.replace(/[^\d.]/g,'')"></el-input>
                        </el-form-item>
                        <el-form-item label="销售价" prop="sellPrice">
                            <el-input v-model="item.sellPrice" oninput="value=value.replace(/[^\d.]/g,'')"></el-input>
                        </el-form-item>
                    </div>
                    <div style="display:flex;">
                        <el-form-item label="会员价" prop="vipPrice">
                            <el-input v-model="item.vipPrice" oninput="value=value.replace(/[^\d.]/g,'')"></el-input>
                        </el-form-item>
                        
                    </div>
                    <hr style=" height:5px;border:none;border-top:2px dotted #D3D7DE;"  >
            </div>
            <el-form-item>
                <el-button type="primary" @click="submitForm('ruleForm')">保存</el-button>
                <el-button type="primary" @click="hotelreturn">返回</el-button>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
    export default {
        name: 'hotelAdd',
        data() {
            //这里存放数据
            return {
                ruleForm: {
                    cityId: null,
                    countyId: null,
                    cityName: "",
                    countyName: "",
                    hotelName: "",
                    pinYin: "",
                    jianPin: "",
                    typeId: null,
                    // 图片路径
                    picPath: "",
                    starId: null,
                    starName: "",
                    brandName: "",
                    circleId: null,
                    circleName: "",
                    themes: "",
                    nearLandmark: "",
                    featureName: "",
                    activelabelName: "",
                    activelabelNameBg: "",
                    address: "",
                    googleLat: null,
                    googleLon: null,
                    baiduLat: null,
                    baiduLon: null,
                    commentScore: null,
                    commentCount: null,
                    baseMinPrice: null,
                    isValid: null,
                    recommendLevel: null,
                    ctripRecommendLevel: null,
                    roomTypeId: null,
                    breakfastId: null,
                    jsjHotelId: "",
                    hotelTypeId: "",
                    hotelEname: "",
                    postCode: "",
                    openingDate: "",
                    isApartment: null,
                    isEconomic: null,
                    renovationDate: "",
                    phone: "",
                    fax: "",
                    facilities: "",
                    generalAmenities: "",
                    recreationAmenities: "",
                    serviceAmenities: "",
                    sellingPoint: "",
                    houseIntro: "",
                    tips: "",
                    traffic: "",
                    surroundings: "",
                    checkinTime: "",
                    servicess: "",
                    parkingLot: "",
                    features: "",
                    featureName: "",
                    child: "",
                    meal: "",
                    pet: "",
                    remarks: "",
                    renovationDate: "",
                    roomName: "",
                    roomEn: "",
                    roomCode: "",
                    roomCount: "",
                    roomArea: "",
                    roomFloor: "",
                    roomPersonCount: "",
                    roomWifi: "",
                    roomDesc: "",
                    roomBedType: "",
                    roomBedCount: "",
                    roomBedWidth: "",
                    roomBedDesc: "",
                    roomPicture: "",
                    priceType: "",
                    priceType: "",
                    endDate: "",
                    commission: null,
                    basePrice: null,
                    sellPrice: null,
                },
                hotelRoomList:[],//房型数组
                // 校验
                rules: {
                    name: [{
                            required: true,
                            message: '请输入活动名称',
                            trigger: 'blur'
                        },
                        {
                            min: 3,
                            max: 5,
                            message: '长度在 3 到 5 个字符',
                            trigger: 'blur'
                        }
                    ],
                }
            }
        },
        components: {},
        //方法集合
        methods: {
            // 添加放行按钮
            addroomtype(){
                let parmas={
                    roomName:'',
                    roomEn:'',
                    roomCount:'',
                    roomPersonCount:'',
                    roomWifi:'',
                    roomDesc:'',
                    roomBedType:'',
                    roomBedCount:'',
                    roomBedWidth:'',
                    roomBedDesc:'',
                    roomPicture:'',
                    hotelRoomPriceList: [{
                                priceType:  '',
                                beginDate:'',
                                endDate: '',
                                commission: null,
                                basePrice: null,
                                sellPrice: null,
                                vipPrice: null,
                            }],
                }
               this.hotelRoomList.push(parmas)
               console.log(this.hotelRoomList)
            },
            //房型删除按钮
            handelDelet(item, index) {
                this.hotelRoomList.splice(index, 1);
            },
            // 入参
            getinsertHotel() {
                localStorage.setItem("isToken", true);
                let arr = {
                    hotelType:"Crm",
                    cityId: Number(this.ruleForm.cityId),
                    cityName: this.ruleForm.cityName,
                    countyId: Number(this.ruleForm.countyId),
                    countyName: this.ruleForm.countyName,
                    hotelName: this.ruleForm.hotelName,
                    pinYin: this.ruleForm.pinYin,
                    jianPin: this.ruleForm.jianPin,
                    picPath: this.ruleForm.picPath,
                    typeId: Number(this.ruleForm.typeId),
                    starId: Number(this.ruleForm.starId),
                    starName: this.ruleForm.starName,
                    brandId: Number(this.ruleForm.brandId),
                    brandName: this.ruleForm.brandName,
                    circleId: Number(this.ruleForm.circleId),
                    circleName: this.ruleForm.circleName,
                    themes: this.ruleForm.themes,
                    nearLandmark: this.ruleForm.nearLandmark,
                    featureName: this.ruleForm.featureName,
                    activelabelName: this.ruleForm.activelabelName,
                    activelabelNameBg: this.ruleForm.activelabelNameBg,
                    address: this.ruleForm.address,
                    googleLat: Number(this.ruleForm.googleLat),
                    googleLon: Number(this.ruleForm.googleLon),
                    baiduLat: Number(this.ruleForm.baiduLat),
                    baiduLon: Number(this.ruleForm.baiduLon),
                    commentScore: Number(this.ruleForm.commentScore),
                    commentCount: Number(this.ruleForm.commentCount),
                    baseMinPrice: Number(this.ruleForm.baseMinPrice),
                    isValid: Number(this.ruleForm.isValid),
                    facilitieIds: this.ruleForm.facilitieIds,
                    recommendLevel: Number(this.ruleForm.recommendLevel),
                    ctripRecommendLevel: Number(this.ruleForm.ctripRecommendLevel),
                    jsjHotelId: this.ruleForm.jsjHotelId,
                    hotelTypeId: this.ruleForm.hotelTypeId,
                    roomTypeId: Number(this.ruleForm.roomTypeId),
                    breakfastId: Number(this.ruleForm.breakfastId),
                    hotelInfo: {
                        hotelEname: this.ruleForm.hotelEname,
                        postCode: this.ruleForm.postCode,
                        openingDate: this.ruleForm.openingDate,
                        isApartment: Number(this.ruleForm.isApartment),
                        isEconomic: Number(this.ruleForm.isEconomic),
                        renovationDate: this.ruleForm.renovationDate,
                        phone: this.ruleForm.phone,
                        fax: this.ruleForm.fax,
                        facilities: this.ruleForm.facilities,
                        generalAmenities: this.ruleForm.generalAmenities,
                        recreationAmenities: this.ruleForm.recreationAmenities,
                        serviceAmenities: this.ruleForm.serviceAmenities,
                        sellingPoint: this.ruleForm.sellingPoint,
                        houseIntro: this.ruleForm.houseIntro,
                        tips: this.ruleForm.tips,
                        traffic: this.ruleForm.traffic,
                        surroundings: this.ruleForm.surroundings,
                        checkinTime: this.ruleForm.checkinTime,
                        servicess: this.ruleForm.servicess,
                        themes: this.ruleForm.themes,
                        parkingLot: this.ruleForm.parkingLot,
                        features: this.ruleForm.features,
                        featureName: this.ruleForm.featureName,
                        child: this.ruleForm.child,
                        meal: this.ruleForm.meal,
                        pet: this.ruleForm.pet,
                        remarks: this.ruleForm.remarks,
                        // hotelRoomList: [{
                        //     roomName: this.ruleForm.roomName,
                        //     roomEn: this.ruleForm.roomEn,
                        //     roomEn: this.ruleForm.roomEn,
                        //     roomCount: this.ruleForm.roomCount,
                        //     roomPersonCount: this.ruleForm.roomPersonCount,
                        //     roomWifi: this.ruleForm.roomWifi,
                        //     roomDesc: this.ruleForm.roomDesc,
                        //     roomBedType: this.ruleForm.roomBedType,
                        //     roomBedCount: this.ruleForm.roomBedCount,
                        //     roomBedWidth: this.ruleForm.roomBedWidth,
                        //     roomBedDesc: this.ruleForm.roomBedDesc,
                        //     roomPicture: this.ruleForm.roomPicture,
                        //     hotelRoomPriceList: [{
                        //         priceType: this.ruleForm.priceType,
                        //         beginDate: this.ruleForm.beginDate,
                        //         endDate: this.ruleForm.endDate,
                        //         commission: Number(this.ruleForm.commission),
                        //         basePrice: Number(this.ruleForm.basePrice),
                        //         sellPrice: Number(this.ruleForm.sellPrice),
                        //         vipPrice: Number(this.ruleForm.vipPrice),
                        //     }],

                        // }],
                        hotelRoomList:this.hotelRoomList
                    },

                }
                console.log(arr,this.hotelRoomList)
                // return false
                this.$axios.getinsertHotel(arr).then((res) => {
                    
                    console.log(res)
                    if (res.code == 200) {
                        this.$message({
                            message: '新增成功',
                            type: 'success'
                        });
                        this.ruleForm = {}
                        this.$router.go(-1)
                    }
                })
            },
            // 返回
            hotelreturn() {
                this.$router.go(-1)
            },
             // 图片返回数据
      handleAvatarSuccess(response) {
        //
        console.log(response)
        if (this.ruleForm.picPath	 == '') {
          console.log(response)
          this.ruleForm.picPath = response[0]
        }

      },
       handlePictureCardPreview(file) {
        console.log(file)
        this.dialogImageUrl = file.url;
        this.dialogVisible = true;
      },
       //
      handleRemove(file, fileList) {
        console.log(file, fileList);
      },
            // 保存 
            submitForm(formName) {
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        this.getinsertHotel()
                    } else {
                        console.log('error submit!!');
                        return false;
                    }
                });
            },
        },
        created() {

        },
        mounted() {

        }
    }
</script>
<style scoped>
    .hotelAdd {
        margin: 20px;
    }
</style>